home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 …ember: Reference Library / Apple Developer Reference Library (December 1999) (Disk 1).iso / pc / technical documentation / develop / develop issue 23 / develop issue 23 code / projectdrag 1.1b8.sea / ProjectDrag 1.1b8 / Sources / ProjectDrag Sources / PDUtilities.h / PDUtilities.h
Encoding:
C/C++ Source or Header  |  1995-09-07  |  4.4 KB  |  144 lines  |  [TEXT/MPS ]

  1. /* PDUtilities.h: Utility routines and resource declarations for ProjectDrag
  2.  *
  3.  * A set of applets for drag and drop source control by Tim Maroney.
  4.  * See develop, issue 23 for details.
  5.  *
  6.  * Built on DropShell by Leonard Rosenthol, Stephan Somogyi, and Marshall Clow,
  7.  * and using the MoreFiles utilities by Jim Luther.
  8.  *
  9.  * This software is free, but don't modify and redistribute it without
  10.  * changing the status window to indicate your name and your changes!
  11.  */
  12.  
  13. #ifndef __PDUTILITIES__
  14. #define __PDUTILITIES__
  15.  
  16. #include <Types.h>
  17. #include <Files.h>
  18.  
  19.  
  20. typedef enum { kConfirmYes, kConfirmNo, kConfirmCancel } ConfirmResponse;
  21.  
  22.  
  23. #define kSelectWithPromptDialog 212
  24.  
  25.  
  26. #define kProjectDragStrings 101
  27. #define kPrefsFolderName 1
  28. #define kPrefsFileName 2
  29. #define kWhatYouChangedIn 3
  30. #define kWhatYouWillDoWith 4
  31. #define kNoUserSettings 5
  32. #define kCantGetCKID 6
  33. #define kCantFindProject 7
  34. #define kProjectorError 8
  35. #define kProjectorOutput 9
  36. #define kIdleStatus 10
  37. #define kMountStatus 11
  38. #define kTimsByline 12
  39. #define kAddHeader 13
  40. #define kAnErrorOccured 14
  41. #define kFirstCheckedIn 15
  42. #define kFindingSourceServer 16
  43. #define kCantAddComment 17
  44. #define kExplainChange 18
  45. #define kConfirmDiscardChanges 19
  46. #define kNoCheckInPermission 20
  47. #define kNoCheckOutPermission 21
  48. #define kNoMROPermission 22
  49. #define kCantWritePrefs 23
  50. #define kGettingUserName 24
  51. #define kAddingChangeComment 25
  52. #define kFindingProject 26
  53. #define kSelectDB 27
  54. #define kCantFindProjectCanYou 28
  55. #define kMROCommentFailedCancel 29
  56. #define kCheckoutCommentFailedCancel 30
  57. #define kNameMappingFile 31
  58. #define kConfirmAddFile 32
  59. #define kCantCancel 33
  60. #define kExternalCheckinFailedCancel 34
  61. #define kCancelEvenThoughNotCheckedOut 35
  62. #define kPreviousCommentFileName 36
  63.  
  64. // The structure of a Projector 'ckid' resource
  65.  
  66. typedef struct {
  67.     unsigned long    checkSum;
  68.     long            LOC;                /* location identifier */
  69.     short            version;            /* ckid version number */
  70.     short            writeable;            /* Check out state */
  71.     char            branch;                /* if modifiable & true then branch was made on check out */
  72.     Boolean            modifyReadOnly;        /* did user execute “ModifyReadOnly” on this file? */
  73.  
  74.     unsigned long    unused;
  75.     unsigned long    checkoutTime;        /* date and time of checkout */
  76.     unsigned long    modificationTime;    /* mod date of file */
  77.     
  78.     unsigned long    projectIdA;            /* PID.a */
  79.     unsigned long    projectIdB;            /* PID.b */
  80.     
  81.     short            userId;                /* user ID */
  82.     short            fileId;                /* file ID */
  83.     short            revisionId;            /* rev ID */
  84.     
  85.     Str255            projectPath;        /* Project path -- variable size! */
  86.     
  87.     /* These fields cannot be represented in a struct
  88.     ** but are listed here as documentation:
  89.     
  90.     char;                                /* Byte = 0 *
  91.     PString            userName;            /* User name *
  92.     char;                                /* Byte = 0 *
  93.     PString            revisionNumber;        /* Revision number *
  94.     char;                                /* Byte = 0 *
  95.     PString            fileName;            /* File name *
  96.     char;                                /* Byte = 0 *
  97.     PString            task;                /* task *
  98.     char;                                /* Byte = 0 *
  99.     PString            comment;            /* comment *
  100.     char;                                /* Byte = 0 *
  101.  
  102.     **/
  103.     
  104. } CKIDRec, *CKIDPtr, **CKIDHandle;
  105.  
  106. typedef char *CString;
  107. typedef CString *CStringPtr, **CStringHandle;
  108.  
  109. OSErr ExtractCKID(FSSpec *file, CKIDHandle *theCKID);
  110.  
  111. OSErr FindPreferencesFolder(short *vRefNum, long *folderID);
  112.  
  113. void AppendString(unsigned char *original, unsigned char *append);
  114.  
  115. OSErr MakeFullPathName(FSSpec *spec, Str255 fullPathName);
  116.  
  117. OSErr ProcessFileOrFolder(FSSpec *spec, void (*doFile)(FSSpec *spec, Boolean doingFolde),
  118.                          OSErr (*doFolder)(short vRefNum, long folderID,
  119.                                            void (*doFile)(FSSpec *spec, Boolean doingFolde)));
  120.     
  121. OSErr ProcessFolder(short vRefNum, long folderID, void (*doFile)(FSSpec *spec, Boolean doingFolde));
  122.  
  123. pascal Boolean ProjectDragIdleProc(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn);
  124.  
  125. short ReplaceString(Handle baseText, StringPtr key, StringPtr substitutionText);
  126.  
  127. void ReplaceInIndString(StringPtr stringOut, short strListID, short strIndex,
  128.                         StringPtr param1, StringPtr param2,
  129.                         StringPtr param3, StringPtr param4);
  130.                         
  131. long LineSize(StringPtr theLine, long maxSize);
  132.  
  133. Boolean MatchLineUntilChar(StringPtr line1, long len1, StringPtr line2, long len2, char untilChar);
  134.  
  135. Boolean MatchLine(StringPtr line1, long len1, StringPtr line2, long len2);
  136.  
  137. OSErr GetFileData(FSSpec *file, Handle *fileData, short *refNum);
  138.  
  139. OSErr WriteFileWithHeader(short refNum, Handle fileData, long startOffset, StringHandle header);
  140.  
  141. OSErr SetFileLabel(FSSpec *file, short label, short *oldLabel);
  142.  
  143. #endif
  144.